﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Subplicity.Models
{
    public class UserLoginModel
    {
        [Required(ErrorMessage = "UserName Required.")]
        public string UserName { get; set; }
        [Required(ErrorMessage = "Password Required.")]
        public string Password { get; set; }
    }

    public class JsonObject
    {
        public JsonObject()
        {

        }

        public string ForResponse(bool IsSuccess, string Message)
        {
            string success = "true";
            if (!IsSuccess) { success = "false"; }

            return "{\"success\":" + success + ",\"message\":\"" + Message.Replace("\n", "") + "\"}";
        }
        public string ForResponse(bool IsSuccess, string Message, string sJSON)
        {
            string success = "true";
            if (!IsSuccess) { success = "false"; }

            return "{\"success\":" + success + ",\"message\":\"" + Message.Replace("\n", "") + "\",\"j\":" + sJSON + "}";
        }
    }
}